package day5;

public class Phone {
    //定义一个手机类，属性含品牌、价格，具备打电话、发短信的功能
    private String brand;
    private double price;

    public Phone(String brand, double price) {
        this.brand = brand;
        this.price = price;
    }

    public Phone() {
    }

    public void sendMsg(String name, String msg){
        System.out.println("给"+name+"发信息说"+msg);
    }
    public void call(String msg){
        System.out.println("打电话说,"+msg);
    }

    @Override
    public String toString() {
        return "手机品牌："+brand+",价格："+price;
    }
}
